import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import guangdong from '../views/guangdong.vue'

Vue.use(VueRouter)
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/guangdong',
    name: 'guangdong',
    component: guangdong
  },
  {
    path: '/iframe/:id',
    name: 'iframe',
    component: () => import('../views/iframe.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
